package edu.sctu.practice.class02.shuqiqi.assign.assign02;

/**
 * Created by admin on 2015/10/8.
 */
public class Cricle {

    private double radius;//定义一个私有的属性
    public double area;//定义一个公有的属性
    public static int numOfObjects;//静态属性


    //构造方法；
    public Cricle(int numOfObjects) {
        this.numOfObjects = numOfObjects;
    }

    //方法
    public void setRadius(double radius) {

        this.radius = radius;
    }

    //方法
    public double getRadius() {

        return radius;
    }

    //方法
    public double getArea() {
        area = Math.PI * (radius * radius);
        return area;
    }

    //定义一个输出方法
    public void printf() {
        System.out.println("个数" + numOfObjects);
        System.out.println("面积" + getArea());
        System.out.println("半径" + getRadius());
    }

}
